#include"mainwidget.h"
#include"gamewidge.h"
#include"easy.h"
#include<QWidget>
#include<QVBoxLayout>
#include<QIcon>
#include<QBrush>
#include<QLabel>
#include<QPushButton>


gamewidge::gamewidge(QWidget *parent) : QWidget(parent)
{
    this->parent=parent;
    this->setFixedSize(800,417);
    this->setWindowTitle("STAR WARS");

    this->setAutoFillBackground(true);
    this->setWindowIcon(QIcon("img/DS.png"));

    QPalette palette;
    palette.setBrush(QPalette::Background,QBrush(QPixmap("img/BG.png")));
    this->setPalette(palette);

    this->easybtn=new QPushButton(this);
    this->easybtn->setIcon(QIcon("img/easy.png"));
    this->easybtn->setIconSize(QSize(141,41));
    this->easybtn->setFlat(true);
    this->easybtn->setFocusPolicy(Qt::NoFocus);

    this->commonbtn=new QPushButton(this);
    this->commonbtn->setIcon(QIcon("img/common.png"));
    this->commonbtn->setIconSize(QSize(141,41));
    this->commonbtn->setFlat(true);
    this->commonbtn->setFocusPolicy(Qt::NoFocus);

    this->hardbtn=new QPushButton(this);
    this->hardbtn->setIcon(QIcon("img/hard.png"));
    this->hardbtn->setIconSize(QSize(141,41));
    this->hardbtn->setFlat(true);
    this->hardbtn->setFocusPolicy(Qt::NoFocus);


    this->returnbtn=new QPushButton(this);
    this->returnbtn->setIcon(QIcon("img/return.png"));
    this->returnbtn->setIconSize(QSize(141,41));
    this->returnbtn->setFlat(true);
    this->returnbtn->setFocusPolicy(Qt::NoFocus);

    this->vboxlayout=new QVBoxLayout(this);
    this->vboxlayout->addWidget(easybtn);
    this->vboxlayout->addWidget(commonbtn);
    this->vboxlayout->addWidget(hardbtn);
    this->vboxlayout->addWidget(returnbtn);
    this->vboxlayout->setAlignment(Qt::AlignCenter);

    this->connect(returnbtn,SIGNAL(clicked()),this,SLOT(returnbtnclick()));
    this->connect(easybtn,SIGNAL(clicked()),this,SLOT(easybtnclick()));

}

void gamewidge::returnbtnclick()
{
    this->hide();
}

void gamewidge::easybtnclick()
{
    this->parent->hide();
    easyview=new Easy;
    easyview->show();
}

void gamewidge::commonbtnclick()
{

}

void gamewidge::hardbtnclick()
{

}

